# SDK module

add_library(sdfx_sdk SHARED
    src/sdfx_api.c
    src/sdf_device.c
    src/sdf_random.c
    src/sdf_hash.c
    src/sdf_symmetric.c
    src/sdf_asymmetric.c
    src/protocol_client.c
    src/handle_manager.c
    src/error_handler.c
    src/sdf_stubs.c
    src/sdf_stubs_sm9_vpn.c
    ../common/src/config.c
)

target_include_directories(sdfx_sdk PRIVATE
    ${CMAKE_CURRENT_SOURCE_DIR}/../include
    ${CMAKE_CURRENT_SOURCE_DIR}/include
)

target_link_libraries(sdfx_sdk
    sdfx_transport
    sdfx_protocol
    ${COMMON_LIBS}
)

# Set library version information
set_target_properties(sdfx_sdk PROPERTIES
    VERSION ${PROJECT_VERSION}
    SOVERSION 1
    OUTPUT_NAME sdfx
)

# Install library files
install(TARGETS sdfx_sdk
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
    ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)